/*
 * $Id: PropertyException.java,v 1.1 2009/01/06 21:36:29 navdeep_mahajan Exp $
 * 
 * Copyright (C) 2008 General Electric Company. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 * 
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */
package com.ge.healthcare.autosc.common.exceptions;

/**
 * @author Anthony Siu
 *
 */
public class PropertyException extends Exception {
    /**
     * Auto Generated
     */
    private static final long serialVersionUID = 1L;

    /**
     * The variable is used to error type which helps in identifying the base
     * exception that was thrown. We will be required to catch GenericCommandException
     * only then we can place a switch block to see the base exception
     */
    protected int errorType = -1;

    /**
     * @param objThrowable
     * @param iErrorType
     */
    public PropertyException(Throwable objThrowable, int iErrorType) {
        super(objThrowable);
        this.errorType = iErrorType;
    }

    /**
     * @param strMessage
     */
    public PropertyException(String strMessage, int iErrorType) {
        super(strMessage);
        this.errorType = iErrorType;
    }
    
    /**
     * @param strMessage
     * @param objThrowable
     */
    public PropertyException(String strMessage, Throwable objThrowable, int iErrorType) {
        super(strMessage, objThrowable);
        this.errorType = iErrorType;
    }
    
    /**
     * @param strMessage
     * @param iErrorType
     */
    public PropertyException(String strMessage) {
        super(strMessage);
    }
    
    /**
     * @param strMessage - Error Message
     * @param objThrowable - other throwable
     */
    public PropertyException(String strMessage, Throwable objThrowable) {
    	super(strMessage, objThrowable);
    }
    
    /**
     * @return error type associated with the Exception
     */
    public int getErrorType() {
        return errorType;
    }

    /**
     * @param errorType
     *            Sets error type of the exception
     */
    public void setErrorType(int errorType) {
        this.errorType = errorType;
    }
}
